﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Data.SqlClient;

namespace 徐汉权
{
    public class Dbepr
    {
        private static readonly string conString = "severe=.;database=CMS;uid=sa;pwd=123456;";

        public static DataTable dataTable(string sql) 
        {
            SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(sql,conString);
            DataTable dataTable = new DataTable();
            sqlDataAdapter.Fill(dataTable);
            return dataTable;
        }

        public static int OrUpdataOrDelete(string sql) 
        {
            SqlConnection sqlConnection = new SqlConnection(conString);
            SqlCommand sqlCommand = new SqlCommand(sql, sqlConnection);
            sqlConnection.Open();
            var bt = sqlCommand.ExecuteNonQuery();
            sqlConnection.Close();
            return bt;
        }
    }
}